From: Jonas Dreßler Date: Fri, 8 Apr 2022 23:21:54 +0000 (+0200) Subject: search: Use ClutterPanGesture for touchscreen scrolling X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~43 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c3b1057e6df824dd76d2422ceb1d2d55f6e9088f;p=gnome-shell.git search: Use ClutterPanGesture for touchscreen scrolling ClutterPanGesture replaced ClutterPanAction and uses Clutters new gesture tracker, let's switch to the shiny new thing. Part-of: --- diff --git a/js/ui/search.js b/js/ui/search.js index 44db1ac75..8ac92888a 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -582,9 +582,9 @@ export const SearchResultsView = GObject.registerClass({ child: this._content, }); - let action = new Clutter.PanAction({interpolate: true}); - action.connect('pan', this._onPan.bind(this)); - this._scrollView.add_action(action); + const panGesture = new Clutter.PanGesture(); + panGesture.connect('pan-update', this._onPanUpdate.bind(this)); + this._scrollView.add_action(panGesture); this.add_child(this._scrollView); @@ -761,11 +761,11 @@ export const SearchResultsView = GObject.registerClass({ this.emit('terms-changed'); } - _onPan(action) { - let [dist_, dx_, dy] = action.get_motion_delta(0); - let adjustment = this._scrollView.vadjustment; - adjustment.value -= (dy / this.height) * adjustment.page_size; - return false; + _onPanUpdate(gesture) { + const adjustment = this._scrollView.vadjustment; + const delta = gesture.get_delta(); + + adjustment.value -= (delta.get_y() / this.height) * adjustment.page_size; } _focusChildChanged(provider) {